Add a read barrier to the time-values-uptodate xenlinux time checking function.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 14 Mar 2006 16:35:38 +0000 (17:35 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 14 Mar 2006 16:35:38 +0000 (17:35 +0100)
Also fix monotonic clock to use just a compile barrier instead of smp_rmb.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c

index 62139abbe4cc139139c3e025cf6b375124fa1365..9d0054980e71dd46efa8b6933d48d942f7101c20 100644 (file)
@@ -332,6 +332,7 @@ static inline int time_values_up_to_date(int cpu)
        src = &HYPERVISOR_shared_info->vcpu_info[cpu].time;
        dst = &per_cpu(shadow_time, cpu);
 
+       rmb();
        return (dst->version == src->version);
 }
 
@@ -558,11 +559,11 @@ unsigned long long monotonic_clock(void)
 
        do {
                local_time_version = shadow->version;
-               smp_rmb();
+               barrier();
                time = shadow->system_timestamp + get_nsec_offset(shadow);
                if (!time_values_up_to_date(cpu))
                        get_time_values_from_xen();
-               smp_rmb();
+               barrier();
        } while (local_time_version != shadow->version);
 
        put_cpu();